package com.magicmovie.web.service;

import com.magicmovie.entity.Order;
import com.magicmovie.utils.QueryFilters;
import com.magicmovie.utils.data.PageModel;
import com.magicmovie.web.service.impl.OrderServiceImpl;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.ws.rs.GET;
import java.util.List;
import java.util.Map;

@FeignClient(name = "service",fallback = OrderServiceImpl.class)
public interface OrderService {
    @RequestMapping(value = "/order/findByUidAndMovieId",method = RequestMethod.GET)
    Order findByUidAndMovieId(@RequestParam("uid") Integer uid, @RequestParam("movieId") Integer movieId);

    @RequestMapping(value = "/order/getByFilter",method = RequestMethod.POST)
    PageModel getByFilter(@RequestBody QueryFilters filters);

    @RequestMapping(value = "/order/getMoneyByFilter",method = RequestMethod.POST)
    Double getMoneyByFilter(@RequestBody QueryFilters filters);

    @GetMapping("/order/bestSellingList")
    List<Map<String,Object>> bestSellingList();

    @GetMapping("/order/mostPaidUserList")
    List<Map<String,Object>> mostPaidUser();

    /**
     * 根据类型统计
     * 1： 统计总付费用户 2:总订单数 3：订单总价 4：总域名数
     * @param type
     * @return
     */
    @GetMapping("/order/statisticsByType")
    Integer statisticsByType(@RequestParam("type") Integer type);
}
